package com.google.android.exoplayer2.upstream;

import android.net.Uri;
import androidx.annotation.Nullable;
import com.huawei.hms.framework.network.restclient.hwhttp.HttpContants;
import com.huawei.hwid.core.constants.HwAccountConstants;
import java.util.Arrays;
import o.amm;

public final class DataSpec {
    @Nullable
    public final String ʻ;
    public final int ʽ;
    public final long ˊ;
    @Nullable
    public final byte[] ˋ;
    public final Uri ˎ;
    @Deprecated
    @Nullable
    public final byte[] ˏ;
    public final int ॱ;
    public final long ॱॱ;
    public final long ᐝ;

    public DataSpec(Uri uri) {
        this(uri, 0);
    }

    public DataSpec(Uri uri, int i) {
        this(uri, 0, -1, null, i);
    }

    public DataSpec(Uri uri, long j, long j2, @Nullable String str) {
        this(uri, j, j, j2, str, 0);
    }

    public DataSpec(Uri uri, long j, long j2, @Nullable String str, int i) {
        this(uri, j, j, j2, str, i);
    }

    public DataSpec(Uri uri, long j, long j2, long j3, @Nullable String str, int i) {
        this(uri, null, j, j2, j3, str, i);
    }

    public DataSpec(Uri uri, @Nullable byte[] bArr, long j, long j2, long j3, @Nullable String str, int i) {
        this(uri, bArr != null ? 2 : 1, bArr, j, j2, j3, str, i);
    }

    public DataSpec(Uri uri, int i, @Nullable byte[] bArr, long j, long j2, long j3, @Nullable String str, int i2) {
        amm.ˊ(j >= 0);
        amm.ˊ(j2 >= 0);
        boolean z = j3 > 0 || j3 == -1;
        amm.ˊ(z);
        this.ˎ = uri;
        this.ॱ = i;
        if (bArr == null || bArr.length == 0) {
            bArr = null;
        }
        this.ˋ = bArr;
        this.ˏ = this.ˋ;
        this.ˊ = j;
        this.ॱॱ = j2;
        this.ᐝ = j3;
        this.ʻ = str;
        this.ʽ = i2;
    }

    public boolean ˊ(int i) {
        return (this.ʽ & i) == i;
    }

    public String toString() {
        return "DataSpec[" + ˎ() + HwAccountConstants.BLANK + this.ˎ + ", " + Arrays.toString(this.ˋ) + ", " + this.ˊ + ", " + this.ॱॱ + ", " + this.ᐝ + ", " + this.ʻ + ", " + this.ʽ + "]";
    }

    public final String ˎ() {
        return ॱ(this.ॱ);
    }

    public static String ॱ(int i) {
        switch (i) {
            case 1:
                return HttpContants.HTTP_METHOD_GET;
            case 2:
                return "POST";
            case 3:
                return "HEAD";
            default:
                throw new AssertionError(i);
        }
    }

    public DataSpec ॱ(long j, long j2) {
        if (j == 0 && this.ᐝ == j2) {
            return this;
        }
        return new DataSpec(this.ˎ, this.ॱ, this.ˋ, this.ˊ + j, this.ॱॱ + j, j2, this.ʻ, this.ʽ);
    }
}
